-
Notifications
You must be signed in to change notification settings - Fork 13.4k
rustc_target: Add msync target feature and enable it on powerpcspe targets #137860
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
These commits modify compiler targets. |
Looks good to me! I can't test it at the moment thought as my Debian PowerPCSPE systems are currently put into storage. |
3bd251f
to
6f7fd11
Compare
@taiki-e Can you add a brief discussion of the CPU architectures relevant to this target to its platform support page? |
I wasn't sure what exactly you wanted documented and where, but I opened a PR to add the documentation that I thought was missing: #137868 |
Thanks, that looks good. @bors r+ rollup |
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#137375 (Minor internal comments fix for `BufRead::read_line`) - rust-lang#137641 (More precisely document `Global::deallocate()`'s safety.) - rust-lang#137755 (doc: update Wasmtime flags) - rust-lang#137851 (improve `simd_select` error message when used with invalid mask type) - rust-lang#137860 (rustc_target: Add msync target feature and enable it on powerpcspe targets) - rust-lang#137871 (fix `RangeBounds::is_empty` documentation) - rust-lang#137873 (Disable `f16` on Aarch64 without `neon`) - rust-lang#137876 (Adjust triagebot.toml entries for `rustc_mir_build/src/builder/`) - rust-lang#137883 (edit mailmap) - rust-lang#137886 (`name()` and `trimmed_name()` for `stable_mir::crate_def::DefId`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#137860 - taiki-e:powerpcspe-msync, r=workingjubilee rustc_target: Add msync target feature and enable it on powerpcspe targets Some older PowerPC processors do not have the `sync` (`sync 0`) and `lwsync` (`sync 1`) instructions, but instead have the `msync` instruction. (IIRC `msync` and `sync` will be assembled into the same bit-pattern, but `lwsync` will be SIGILL. See also https://gcc.gnu.org/legacy-ml/gcc-patches/2006-11/msg01238.html.) LLVM recognizes this as the [`msync` feature](https://github.com/llvm/llvm-project/blob/cc5d8a4b2fc765c3c432f1ad0b185dae518d41bd/llvm/lib/Target/PowerPC/PPC.td#L140) and enables for some cpus such as [e500](https://github.com/llvm/llvm-project/blob/cc5d8a4b2fc765c3c432f1ad0b185dae518d41bd/llvm/lib/Target/PowerPC/PPC.td#L644). powerpcspe is a target for CPUs such as e500 ([Debian Wiki](https://wiki.debian.org/PowerPCSPEPort)). However, the `msync` feature is currently not enabled except for vxworks, and at least since 2022-04, powerpc-unknown-linux-gnuspe was known to not work on real hardware without `-C target-cpu` (e.g., rust-lang#96394, rust-lang#117361). https://github.com/rust-lang/rust/blob/8c392966a013fd8a09e6b78b3c8d6e442bc278e1/compiler/rustc_target/src/spec/targets/powerpc_wrs_vxworks_spe.rs#L28 Fixes rust-lang#117361 cc `@BKPepe` ([powerpc-unknown-linux-muslspe target maintainer](https://doc.rust-lang.org/nightly/rustc/platform-support/powerpc-unknown-linux-muslspe.html#target-maintainers)) cc `@glaubitz` (who added powerpc-unknown-linux-gnuspe in rust-lang#48484) cc `@th0ma7` (who opened rust-lang#117361) r? workingjubilee `@rustbot` label +O-PowerPC +A-target-feature
…ubilee Add minimal platform support documentation for powerpc-unknown-linux-gnuspe Per rust-lang#137860 (comment), add minimal platform support documentation, including a brief summary and links to more detailed information about this target. The added documentation is minimal. This is somewhat similar to [powerpc-unknown-openbsd, which also has no target maintainer](https://doc.rust-lang.org/nightly/rustc/platform-support/powerpc-unknown-openbsd.html). The rest of the template is left to target maintainers. I also updated powerpc-unknown-linux-muslspe platform support documentation and added link to powerpc-unknown-linux-gnuspe platform support documentation. cc `@glaubitz` cc `@BKPepe` r? workingjubilee `@rustbot` label +O-PowerPC
…ubilee Add minimal platform support documentation for powerpc-unknown-linux-gnuspe Per rust-lang#137860 (comment), add minimal platform support documentation, including a brief summary and links to more detailed information about this target. The added documentation is minimal. This is somewhat similar to [powerpc-unknown-openbsd, which also has no target maintainer](https://doc.rust-lang.org/nightly/rustc/platform-support/powerpc-unknown-openbsd.html). The rest of the template is left to target maintainers. I also updated powerpc-unknown-linux-muslspe platform support documentation and added link to powerpc-unknown-linux-gnuspe platform support documentation. cc ``@glaubitz`` cc ``@BKPepe`` r? workingjubilee ``@rustbot`` label +O-PowerPC
…ubilee Add minimal platform support documentation for powerpc-unknown-linux-gnuspe Per rust-lang#137860 (comment), add minimal platform support documentation, including a brief summary and links to more detailed information about this target. The added documentation is minimal. This is somewhat similar to [powerpc-unknown-openbsd, which also has no target maintainer](https://doc.rust-lang.org/nightly/rustc/platform-support/powerpc-unknown-openbsd.html). The rest of the template is left to target maintainers. I also updated powerpc-unknown-linux-muslspe platform support documentation and added link to powerpc-unknown-linux-gnuspe platform support documentation. cc ```@glaubitz``` cc ```@BKPepe``` r? workingjubilee ```@rustbot``` label +O-PowerPC
Rollup merge of rust-lang#137868 - taiki-e:powerpcspe-doc, r=workingjubilee Add minimal platform support documentation for powerpc-unknown-linux-gnuspe Per rust-lang#137860 (comment), add minimal platform support documentation, including a brief summary and links to more detailed information about this target. The added documentation is minimal. This is somewhat similar to [powerpc-unknown-openbsd, which also has no target maintainer](https://doc.rust-lang.org/nightly/rustc/platform-support/powerpc-unknown-openbsd.html). The rest of the template is left to target maintainers. I also updated powerpc-unknown-linux-muslspe platform support documentation and added link to powerpc-unknown-linux-gnuspe platform support documentation. cc ```@glaubitz``` cc ```@BKPepe``` r? workingjubilee ```@rustbot``` label +O-PowerPC
Add minimal platform support documentation for powerpc-unknown-linux-gnuspe Per rust-lang/rust#137860 (comment), add minimal platform support documentation, including a brief summary and links to more detailed information about this target. The added documentation is minimal. This is somewhat similar to [powerpc-unknown-openbsd, which also has no target maintainer](https://doc.rust-lang.org/nightly/rustc/platform-support/powerpc-unknown-openbsd.html). The rest of the template is left to target maintainers. I also updated powerpc-unknown-linux-muslspe platform support documentation and added link to powerpc-unknown-linux-gnuspe platform support documentation. cc ```@glaubitz``` cc ```@BKPepe``` r? workingjubilee ```@rustbot``` label +O-PowerPC
Add minimal platform support documentation for powerpc-unknown-linux-gnuspe Per rust-lang/rust#137860 (comment), add minimal platform support documentation, including a brief summary and links to more detailed information about this target. The added documentation is minimal. This is somewhat similar to [powerpc-unknown-openbsd, which also has no target maintainer](https://doc.rust-lang.org/nightly/rustc/platform-support/powerpc-unknown-openbsd.html). The rest of the template is left to target maintainers. I also updated powerpc-unknown-linux-muslspe platform support documentation and added link to powerpc-unknown-linux-gnuspe platform support documentation. cc ```@glaubitz``` cc ```@BKPepe``` r? workingjubilee ```@rustbot``` label +O-PowerPC
Some older PowerPC processors do not have the
sync
(sync 0
) andlwsync
(sync 1
) instructions, but instead have themsync
instruction. (IIRCmsync
andsync
will be assembled into the same bit-pattern, butlwsync
will be SIGILL. See also https://gcc.gnu.org/legacy-ml/gcc-patches/2006-11/msg01238.html.)LLVM recognizes this as the
msync
feature and enables for some cpus such as e500.powerpcspe is a target for CPUs such as e500 (Debian Wiki). However, the
msync
feature is currently not enabled except for vxworks, and at least since 2022-04, powerpc-unknown-linux-gnuspe was known to not work on real hardware without-C target-cpu
(e.g., #96394, #117361).rust/compiler/rustc_target/src/spec/targets/powerpc_wrs_vxworks_spe.rs
Line 28 in 8c39296
Fixes #117361
cc @BKPepe (powerpc-unknown-linux-muslspe target maintainer)
cc @glaubitz (who added powerpc-unknown-linux-gnuspe in #48484)
cc @th0ma7 (who opened #117361)
r? workingjubilee
@rustbot label +O-PowerPC +A-target-feature